package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 1:25:05 PM by Hibernate Tools 3.2.0.CR1

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CdInvAdmTrib generated by hbm2java
 */
@Entity
@Table(name = "CD_INV_ADM_TRIB", schema = "CTROLDOC")
public class CdInvAdmTrib implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1022627354332107823L;
	private CdInvAdmTribId id;
	private CdTipoDocum cdTipoDocum;
	private TbAdmTrib tbAdmTrib;
	private String cusuario;
	private Long nsecuencial;
	private Date fhultSecuencial;

	public CdInvAdmTrib() {
	}

	public CdInvAdmTrib(CdInvAdmTribId id, CdTipoDocum cdTipoDocum,
			TbAdmTrib tbAdmTrib, Long nsecuencial, Date fhultSecuencial) {
		this.id = id;
		this.cdTipoDocum = cdTipoDocum;
		this.tbAdmTrib = tbAdmTrib;
		this.nsecuencial = nsecuencial;
		this.fhultSecuencial = fhultSecuencial;
	}

	public CdInvAdmTrib(CdInvAdmTribId id, CdTipoDocum cdTipoDocum,
			TbAdmTrib tbAdmTrib, String cusuario, Long nsecuencial,
			Date fhultSecuencial) {
		this.id = id;
		this.cdTipoDocum = cdTipoDocum;
		this.tbAdmTrib = tbAdmTrib;
		this.cusuario = cusuario;
		this.nsecuencial = nsecuencial;
		this.fhultSecuencial = fhultSecuencial;
	}

	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "cadmTrib", column = @Column(name = "C_ADM_TRIB", nullable = false, length = 2)),
			@AttributeOverride(name = "ctipoExp", column = @Column(name = "C_TIPO_EXP", nullable = false, length = 1)) })
	public CdInvAdmTribId getId() {
		return this.id;
	}

	public void setId(CdInvAdmTribId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_TIPO_EXP", nullable = false, insertable = false, updatable = false)
	public CdTipoDocum getCdTipoDocum() {
		return this.cdTipoDocum;
	}

	public void setCdTipoDocum(CdTipoDocum cdTipoDocum) {
		this.cdTipoDocum = cdTipoDocum;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_ADM_TRIB", nullable = false, insertable = false, updatable = false)
	public TbAdmTrib getTbAdmTrib() {
		return this.tbAdmTrib;
	}

	public void setTbAdmTrib(TbAdmTrib tbAdmTrib) {
		this.tbAdmTrib = tbAdmTrib;
	}

	@Column(name = "C_USUARIO", length = 30)
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@Column(name = "N_SECUENCIAL", nullable = false, precision = 7, scale = 0)
	public Long getNsecuencial() {
		return this.nsecuencial;
	}

	public void setNsecuencial(Long nsecuencial) {
		this.nsecuencial = nsecuencial;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "FH_ULT_SECUENCIAL", nullable = false, length = 7)
	public Date getFhultSecuencial() {
		return this.fhultSecuencial;
	}

	public void setFhultSecuencial(Date fhultSecuencial) {
		this.fhultSecuencial = fhultSecuencial;
	}

}
